package com.hydl.power.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hydl.power.mapper.MaxDataMapper;
import com.hydl.power.pojo.Load;
import com.hydl.power.service.MaxDataService;
import com.hydl.power.utils.TableUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MaxDataServiceImpl implements MaxDataService {
    @Autowired
     private  MaxDataMapper maxDataMapper;
    @Override
    public TableUtils selectByConditions(Integer pageNum, Integer pageSize, String area, String project, String powerRoom, String funType, String dataType, String startTime, String endTime) {
        Page page = PageHelper.startPage(pageNum,pageSize);
        List<Load> list = maxDataMapper.selectByConditions( pageNum,  pageSize,  area,  project,  powerRoom,  funType,  dataType,  startTime,  endTime);
        TableUtils tableUtils = new TableUtils();
        tableUtils.setTotal(page.getTotal());
        tableUtils.setRows(list);
        return tableUtils;
    }
}
